/**
 *  文件名:Activity_setting.java
 *  修改人:lihangjie
 *  创建时间:2015-8-27 下午10:46:54
 */
package com.sharemob.tinchat.modules.account;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;

import com.sharemob.tinchat.R;
import com.sharemob.tinchat.base.BaseActivity;
import com.sharemob.tinchat.base.Item;
import com.sharemob.tinchat.base.ListAdapter;
import com.sharemob.tinchat.base.NoScrollListview;

/**
 * 
 * <一句话功能简述>
 *
 * @author lihangjie
 * version [版本号,2015-8-27 下午10:46:54]
 * @see    [相关类/方法]
 * @since  [产品/模块版本]
 *
 */
public class ActivitySetting extends BaseActivity {


	private NoScrollListview phoneDindingListview;
	private NoScrollListview aboutusSettingListview;

	private Map<String,String> aboutusMap;
	private Map<String,String> bindingMap;
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_setting);
        
        bindingMap=new LinkedHashMap<String,String>();
        bindingMap.put("binding", "手机号绑定");
        phoneDindingListview=getInitListView(bindingMap,R.id.ll_bindingphone_setting);
        
        aboutusMap=new LinkedHashMap<String,String>();
        aboutusMap.put("evaluate", "给我们评价");
        aboutusMap.put("aboutus", "关于我们");
        aboutusSettingListview=getInitListView(aboutusMap,R.id.ll_aboutus_setting);
        
        this.setTitle("设置");
        exitView(R.id.title_back,R.anim.out_to_right,0);
    }
    
    private void AboutusKeyEvent(int position){
       	String tag=getItemFromMap(aboutusMap,position);
    	
        if("evaluate".equals(tag)){
        	System.out.println("--------给我们评价");
        }else if("aboutus".equals(tag)){
        	System.out.println("-------关于我们");
        	
            Intent intent = new Intent(); 
            intent.setClass(ActivitySetting.this,ActivityAboutus.class);
            startActivity(intent);
            overridePendingTransition(R.anim.activity_open,0); 
        }
    }
    
    private void bindingphoneEvent(int position){
       	String tag=getItemFromMap(bindingMap,position);
    	
        if("binding".equals(tag)){
        	System.out.println("--------手机号绑定");
        	gotoViewByAnim(ActivitySetting.this, BindingPhoneActivity.class, R.anim.in_from_bottom,false);
        }
    }
    
    protected  void keyEventOfListView(int position,int id){
        switch (id) {
		case R.id.ll_aboutus_setting:
				AboutusKeyEvent(position);
			break;
		case R.id.ll_bindingphone_setting:
				bindingphoneEvent(position);
			break;
		default:
			break;
		}
    }
    

}
